package _021_10_8

import "strings"

func reverseWords(s string) string {
	fields := strings.Fields(s)
	for i := 0; i < len(fields)/2; i++ {
		temp := fields[i]
		fields[i] = fields[len(fields)-1-i]
		fields[len(fields)-1-i] = temp
	}
	ret := ""
	for i := 0; i < len(fields)-1; i++ {
		ret += fields[i]
		ret += " "
	}
	ret += fields[len(fields)-1]
	return ret
}
